from xpinyin import Pinyin

p = Pinyin()
# default splitter is `-`
quanpin = p.get_pinyin(u"上海")
print(quanpin)

print(p.get_initials(u"上海", u''))

print(p.get_pinyin(u"上海", show_tone_marks=True))